<template>
  <div class="followStu">
    <courseHeadInfo :courseInfo="courseInfo" />
    <div class="followStu-content">
      <div class="toolBar">
        <el-input
          placeholder="请输入内容"
          v-model="search"
          class="input-with-select"
        >
          <el-select v-model="select" slot="prepend" placeholder="请选择">
            <el-option label="姓名" value="1"></el-option>
            <el-option label="学号" value="2"></el-option>
            <el-option label="班级" value="3"></el-option>
          </el-select>
          <el-button slot="append" icon="el-icon-search"></el-button>
        </el-input>
      </div>
      <FollowTable />
    </div>
  </div>
</template>

<script>
import courseHeadInfo from "@/components/teacherPage/courseHeadInfo/courseHeadInfo";
import FollowTable from "./followTable/followTable.vue";
import { getCourseDetail } from "@/request/courses";

export default {
  components: {
    courseHeadInfo,
    FollowTable,
  },
  data() {
    return {
      courseInfo: {}, // 课程信息
      search: null,
      select: "",
    };
  },
  created() {
    this.fetchCourseInfo({ id: this.$route.query.courseID });
  },
  methods: {
    fetchCourseInfo(parmas) {
      getCourseDetail(parmas).then((res) => {
        if (res.errno === 0) {
          this.courseInfo = res.data;
        }
      });
    },
  },
};
</script>

<style lang="stylus">
.followStu {
  .followStu-content {
    padding-top: 30px;
    margin: 0 auto;
    max-width: 1200px;

    .toolBar {
      margin: 0 auto;
      margin-right: 0;
      margin-bottom: 10px;
      width: 350px;

      .el-select {
        width: 100px;
      }

      .input-with-select .el-input-group__prepend {
        background-color: #fff;
      }
    }
  }
}
</style>